var app = getApp();

Page({
    data: {
        color: "#459cf9",
        fwxy: !0,
        isShare: false
    },
    mdmfx: function() {
        this.setData({
            fwxy: !1,
            isShare: false
        });
    },
    yczz: function() {
        this.setData({
            fwxy: !0
        });
    },
    onLoad: function(t) {
        wx.hideShareMenu({});
        var a = this,
            n = wx.getStorageSync("users");
        this.setData({
            userinfo: wx.getStorageSync("users"),
            userid: n.id,
            username: n.name,
            pt_name: getApp().xtxx.url_name
        });
        app.util.request({
            url: "entry/wxapp/MySx",
            cachetime: "0",
            data: {
                user_id: n.id
            },
            success: function(t) {
                t.data ? a.setData({
                    sxdata: t.data
                }) : a.setData({
                    sxdata: t.data
                });
            }
        }), app.util.request({
            url: "entry/wxapp/MyCode",
            cachetime: "0",
            data: {
                user_id: n
            },
            success: function(t) {
                a.setData({
                    code: t.data
                });
            }
        });
    },
    distribution: function(t) {
        wx.navigateTo({
            url: "distribution"
        });
    },
    downline: function(t) {
        wx.navigateTo({
            url: "downline"
        });
    },
    ranking: function(t) {
        wx.navigateTo({
            url: "ranking"
        });
    },
    invation: function(t) {
        wx.navigateTo({
            url: "index"
        });
    },
    tixian: function(t) {
        wx.navigateTo({
            url: "tixian"
        });
    },
    detaulted: function(t) {
        wx.navigateTo({
            url: "detaulted"
        });
    },
    detault: function(t) {
        wx.navigateTo({
            url: "detault"
        });
    },
    onShow: function() {
        var a = this,
            t = wx.getStorageSync("users").id;
        app.util.request({
            url: "entry/wxapp/MyCommission",
            cachetime: "0",
            data: {
                user_id: t
            },
            success: function(t) {
                a.setData({
                    yjdata: t.data
                });
            }
        });
    },
    // 分享邀请
    onShareAppMessage: function (t) {
        this.setData({
            isShare: false
        });
        return "menu" !== t.from && {
            title: this.data.username + "邀请你来看看" + this.data.pt_name,
            path: "/zh_cjdianc/pages/Liar/loginindex?userid=" + this.data.userid,
            success: function(t) {},
            fail: function(t) {}
        };
    },
    ChangeShare() {
        this.setData({
            isShare: !this.data.isShare
        })
    }
});